using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;

namespace Microsoft.SqlServer.Tools.PublishWizard.Helpers
{
	[ComVisible(false)]
	public class PublishWizardTraceListener : TextWriterTraceListener
	{
		public PublishWizardTraceListener()
		{
		}

		public PublishWizardTraceListener(string fileName) : base(fileName)
		{
		}

		public override void Write(string message)
		{
			base.Write(PublishWizardTraceListener.GetMessage(message));
		}

		public override void WriteLine(string message)
		{
			base.WriteLine(PublishWizardTraceListener.GetMessage(message));
		}

		private static string GetMessage(string message)
		{
			return Thread.CurrentThread.ManagedThreadId + "::" + message;
		}
	}
}
